package com.glsc.ngateway.common.base.domainmapper;

import com.glsc.ngateway.common.base.domain.mysql.cmdb.CmdbPartStandard;
import com.glsc.ngateway.common.base.dto.cmdb.CmdbPartStandardImportDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(componentModel = "spring")
public interface CmdbPartStandardMapper {
    CmdbPartStandardMapper INSTANCE = Mappers.getMapper(CmdbPartStandardMapper.class);

    @Mapping(target = "partType", ignore = true)
    CmdbPartStandardImportDto domain2dto(CmdbPartStandard cmdbPartStandard);

    List<CmdbPartStandardImportDto> domain2dto(List<CmdbPartStandard> cmdbPartStandards);

    @Mapping(target = "id", ignore = true)
    @Mapping(target = "partStandardCode", ignore = true)
    @Mapping(target = "partTypeId", ignore = true)
    @Mapping(target = "reserve1", ignore = true)
    @Mapping(target = "reserve2", ignore = true)
    @Mapping(target = "isDelete", ignore = true)
    @Mapping(target = "cmdbPartType", ignore = true)
    CmdbPartStandard dto2domain(CmdbPartStandardImportDto cmdbPartStandardImportDto);

    List<CmdbPartStandard> dto2domain(List<CmdbPartStandardImportDto> cmdbPartStandardImportDtos);

}
